import { ORDER_LIST } from './actionTypes'
import { CHANGEREADYSTATE } from 'component/scrollView/scrollViewActionsTypes.js'
import Axios from 'axios'
export const orderList = page => dispatch => {
  dispatch({
    type: CHANGEREADYSTATE,
    obj: false
  })
  Axios({
    method: 'get',
    url: '/json/orders.json'
  }).then(res => {
    console.log(res.data)
    console.log(666)
    window.setTimeout(() => {
      dispatch({
        type: ORDER_LIST,
        obj: res.data,
        currentPage: page
      })
      dispatch({
        type: CHANGEREADYSTATE,
        obj: true
      })
    }, 1500)
  })
}
